<template>
	<view class="wrap">
		<view class="b-image" v-if="activityImage" @click="onPreview">
			<image :src="activityImage || '/static/imgs/activity_loading.jpg'" mode="widthFix"></image>
		</view>
		<view class="b-rich" v-else>
			<rich-text :nodes="activityRich"></rich-text>
		</view>
	</view>
</template>

<script>
	import mixinsCommon from '@/mixins/common.js'
	import mixinsAuth from '../../mixins/auth.js'
	import {
		formatRichText
	} from '@/common/util.js'
	export default {
		mixins: [mixinsCommon, mixinsAuth],
		data() {
			return {}
		},
		onLoad() {},
		computed: {
			activityRich() {
				return formatRichText(this.$store.getters.globalConfig.activity_rich)
			},
			activityImage() {
				return this.$store.getters.globalConfig.activity_img
			}
		},
		methods: {
			onPreview() {
				uni.previewImage({
					current: 0,
					urls: [
						this.activityImage
					]
				});
			}
		}
	}
</script>

<style lang="scss">
	page {
		padding-bottom: env(safe-area-inset-bottom);
		background: $pq-bg-color;
	}

	.wrap {}

	.b-rich {
		background: #fff;
		font-size: 28upx;
	}

	.b-image {
		image {
			width: 100%;
			height: 460upx;
		}
	}
</style>
